home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS21.ADF
/
CelScripts
/
AniScript.BAS
< prev
next >
Wrap
BASIC Source File
|
1989-01-27
|
3KB
|
135 lines
' Aegis Animator Script Generator
' By John Foust for Amazing Computing
DIM TagName$(10, 1), TagXOffset%(10), TagYOffset%(10), TagPlane%(10)
DIM TagXPos%(10), TagYPos%(10)
INPUT "Number of tweens: ", NumTweens%
INPUT "Number of pre-existing polygons on the screen: ", BasePoly%
INPUT "Name of base polygon: ", TagName$(0,1)
INPUT "Plane of base polygon: ", TagPlane%(0)
INPUT "Starting X, Y position of base polygon: "; BaseXStart%, BaseYStart%
INPUT "Ending X, Y position of base polygon: "; BaseXEnd%, BaseYEnd%
INPUT "Number of tag-along polygons: ", NumTags%
FOR Tag% = 1 TO NumTags%
PRINT "Name of tag-along"; Tag%; ": ";
INPUT TagName$(Tag%, 1)
PRINT "Name of alternate"; Tag%; ": ";
INPUT TagName$(Tag%, 0)
PRINT "X, Y offset of "; TagName$(Tag%, 1);
PRINT " from "; TagName$(0,1); ": ";
INPUT TagXOffset%(Tag%), TagYOffset%(Tag%)
PRINT "Plane of tag-along"; Tag%; ": ";
INPUT TagPlane%(Tag%)
NEXT Tag%
INPUT "Output script file name: "; OutFile$
OPEN OutFile$ FOR OUTPUT AS #1
' Make a file with .def extension for *defines
OPEN OutFile$+".def" FOR OUTPUT AS #2
' Define the objects in this script
' First the base object
PRINT #2, "*define AMIGA_BITMAP "; TagName$(0,1)
' Then the alternate objects
FOR Tag% = 1 TO NumTags%
PRINT #2, "*define AMIGA_BITMAP "; TagName$(Tag%,1)
PRINT #2, "*define AMIGA_BITMAP "; TagName$(Tag%,0)
NEXT Tag%
CLOSE #2
' Calculate the step size in the X and Y direction for each tween
TweenXStep = (BaseXEnd% - BaseXStart%) / NumTweens%
TweenYStep = (BaseYEnd% - BaseYStart%) / NumTweens%
' Insert the object at the starting point
PRINT #1, "*act 8 INSERT_RASTER "; BasePoly%; TagName$(0,1);
PRINT #1, BaseXStart%; BaseYStart%; TagPlane%(0)
FOR Tag% = 1 TO NumTags%
PRINT #1, "*act 8 INSERT_RASTER "; BasePoly% + Tag%;
PRINT #1, TagName$(Tag%, 1);
PRINT #1, BaseXStart% + TagXOffset%(Tag%);
PRINT #1, BaseYStart% + TagYOffset%(Tag%); TagPlane%(Tag%)
NEXT Tag%
' Start the object moving for the first tween
PRINT #1, "*act 6 MOVE_POLY "; BasePoly%;
PRINT #1, INT(TweenXStep); INT(TweenYStep); 0
FOR Tag% = 1 TO NumTags%
PRINT #1, "*act 6 MOVE_POLY "; BasePoly% + Tag%;
PRINT #1, INT(TweenXStep); INT(TweenYStep); 0
NEXT Tag%
PRINT #1, ""
' Update our position
CurrentXPos% = BaseXStart% + INT(TweenXStep)
CurrentYPos% = BaseYStart% + INT(TweenYStep)
' In each tween, remove each tag-along polygon
' and replace it with its alternate, moving the
' whole object as well. The first tween is done.
FOR Tween% = 2 TO NumTweens%
PRINT #1, "*tween 0 200 0 0"
' Replace each tag-along polygon with its alternate
FOR Tag% = 1 TO NumTags%
PRINT #1, "*act 3 KILL_POLY "; BasePoly% + Tag%
PRINT #1, "*act 8 INSERT_RASTER "; BasePoly% + Tag%;
PRINT #1, TagName$(Tag%, Tween% MOD 2);
PRINT #1, CurrentXPos% + TagXOffset%(Tag%);
PRINT #1, CurrentYPos% + TagYOffset%(Tag%);
PRINT #1, TagPlane%(Tag%)
NEXT Tag%
' Now move the whole object
' Update our position
CurrentXPos% = CurrentXPos% + INT(TweenXStep)
CurrentYPos% = CurrentYPos% + INT(TweenYStep)
PRINT #1, "*act 6 MOVE_POLY "; BasePoly%;
PRINT #1, INT(TweenXStep); INT(TweenYStep); 0
FOR Tag% = 1 TO NumTags%
PRINT #1, "*act 6 MOVE_POLY "; BasePoly% + Tag%;
PRINT #1, INT(TweenXStep); INT(TweenYStep); 0
NEXT Tag%
' Print the blank line between tweens
PRINT #1, ""
NEXT Tween%
CLOSE #1
END